<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>代码生成</title>
    <meta name="keywords" content="代码生成" />
    <meta name="description" content="代码生成" />
    <link rel="shortcut icon" href="favicon.ico" />

    <!-- 引入公共css -->
	<#include "/inc/header.ftl"/>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="page-title-box">
                <p class="page-title">
                    	新增模板路径
                </p>
            </div>
        </div>
    </div>
    <div class="main">
        <div class="main-padding">
            <div class="ibox-content">
                <form class="form-horizontal m-t" id="signupForm">
					
                    <div class="form-group">
                        <label class="col-sm-3 control-label">模板路径名称：</label>
                        <div class="col-sm-8">
                            <input id="path" name="path" class="form-control" type="text" aria-required="true" aria-invalid="false" class="valid">
                        </div>
                    </div>
                   
                    <div class="form-group">
                        <div class="col-sm-8 col-sm-offset-3">
                            <button class="btn btn-primary" type="button" id="createGroup">提交</button>
                            <a class="btn btn-default" href="/auto/code/path/list">返回</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 引入公共js -->
<#include "/inc/footer.ftl"/>

<!-- Page-Level Scripts -->
<script>
    $(document).ready(function() {
        $("#createGroup").on("click", function(){
            var path = $("#path").val();
            $.ajax({
                url : '/auto/code/path/create',
                type : 'POST',
                data : {
                    path:path
                },
                dataType : 'JSON',
                success : function(data) {
                    if(data.status == "200"){
                        parent.layer.alert("新增成功!");
                        setTimeout(function () {
                            window.location.href = "/auto/code/path/list";
                        },500)
                    }else{
                        parent.layer.alert("状态获取失败!");
                    }
                },
                error : function(result) {
                    parent.layer.alert("发生错误！");
                }
            });
        });
    });
</script>
</body>
</html>


